package com.ssy.lingxi.order.model.vo.basic.request;

import com.ssy.lingxi.order.handler.annotation.DeliveryTypeAnnotation;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 新增Srm订单物料接口参数
 * @author 万宁
 * @version 2.0.0
 * @date 2021-07-17
 */
public class SrmOrderProductVO implements Serializable {
    private static final long serialVersionUID = -1656500906007788421L;

    /**
     * 物料Id
     */
    @NotNull(message = "物料Id要大于0")
    @Positive(message = "物料Id要大于0")
    private Long productId;

    /**
     * 物料编号
     */
    @NotBlank(message = "物料编号不能为空")
    @Size(max = 20, message = "物料编号最长20个字符")
    private String productNo;

    /**
     * 物料名称
     */
    @NotBlank(message = "物料名称不能为空")
    @Size(max = 100, message = "物料名称最长100个字符")
    private String name;

    /**
     * 物料品类
     */
    @NotBlank(message = "物料品类不能为空")
    @Size(max = 50, message = "物料品类最长50个字符")
    private String category;

    /**
     * 物料品牌
     */
    @Size(max = 50, message = "物料品牌最长50个字符")
    private String brand;

    /**
     * 物料规格
     */
    @Size(max = 50, message = "物料规格最长50个字符")
    private String spec;

    /**
     * 计价单位
     */
    @NotBlank(message = "物料计价单位不能为空")
    @Size(max = 10, message = "物料计价单位最长10个字符")
    private String unit;

    /**
     * 物料价格
     */
    @NotNull(message = "物料价格要大于等于0")
    @PositiveOrZero(message = "物料价格要大于等于0")
    private BigDecimal price;

    /**
     * 供方库存
     */
    private BigDecimal stock;

    /**
     * 采购数量
     */
    @NotNull(message = "采购数量要大于0")
    @Positive(message = "采购数量要大于0")
    private BigDecimal quantity;

    /**
     * 是否含税（true-含税，false-不含税）
     */
    private Boolean tax;

    /**
     * 税率（百分比的分子部分，例如6%只要传参6）
     */
    private BigDecimal taxRate;

    /**
     * 商品配送方式：1-物流，2-自提，3-无需配送
     */
    @NotNull(message = "商品配送方式不能为空")
    @DeliveryTypeAnnotation
    private Integer deliveryType;

    /**
     * 商品重量，配送方式为物流时要大于0
     */
    private BigDecimal weight;

    /**
     * 运费模板Id，配送方式为物流时要大于0
     */
    private Long logisticsTemplateId;

    /**
     * 自提地址（如配送方式为自提，必填）
     */
    @Size(max = 200, message = "自提地址最长200个字符")
    private String address;

    /**
     * 接收人（如配送方式为自提，必填）
     */
    @Size(max = 50, message = "接收人最长50个字符")
    private String receiver;

    /**
     * 接收人电话（如配送方式为自提，必填）
     */
    @Size(max = 20, message = "接收人最长20个字符")
    private String phone;

    /**
     * 关联报价商品Id，如果有则要大于0
     */
    private Long quotedProductId;

    /**
     * 关联报价商品的SkuId，如果有则要大于0
     */
    private Long quotedSkuId;

    /**
     * 关联报价商品的名称，如果有则不能为空
     */
    @Size(max = 100, message = "关联报价商品最长100个字符")
    private String quotedName;

    /**
     * 关联报价商品的规格
     */
    @Size(max = 255, message = "关联报价商品规格最长255个字符")
    private String quotedSpec;

    /**
     * 关联报价商品的品类，如果有则不能为空
     */
    @Size(max = 50, message = "关联报价商品品类最长50个字符")
    private String quotedCategory;

    /**
     * 关联报价商品的品牌
     */
    @Size(max = 50, message = "关联报价商品品牌最长50个字符")
    private String quotedBrand;

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getStock() {
        return stock;
    }

    public void setStock(BigDecimal stock) {
        this.stock = stock;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    public Boolean getTax() {
        return tax;
    }

    public void setTax(Boolean tax) {
        this.tax = tax;
    }

    public BigDecimal getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(BigDecimal taxRate) {
        this.taxRate = taxRate;
    }

    public Integer getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(Integer deliveryType) {
        this.deliveryType = deliveryType;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public Long getLogisticsTemplateId() {
        return logisticsTemplateId;
    }

    public void setLogisticsTemplateId(Long logisticsTemplateId) {
        this.logisticsTemplateId = logisticsTemplateId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Long getQuotedProductId() {
        return quotedProductId;
    }

    public void setQuotedProductId(Long quotedProductId) {
        this.quotedProductId = quotedProductId;
    }

    public Long getQuotedSkuId() {
        return quotedSkuId;
    }

    public void setQuotedSkuId(Long quotedSkuId) {
        this.quotedSkuId = quotedSkuId;
    }

    public String getQuotedName() {
        return quotedName;
    }

    public void setQuotedName(String quotedName) {
        this.quotedName = quotedName;
    }

    public String getQuotedSpec() {
        return quotedSpec;
    }

    public void setQuotedSpec(String quotedSpec) {
        this.quotedSpec = quotedSpec;
    }

    public String getQuotedCategory() {
        return quotedCategory;
    }

    public void setQuotedCategory(String quotedCategory) {
        this.quotedCategory = quotedCategory;
    }

    public String getQuotedBrand() {
        return quotedBrand;
    }

    public void setQuotedBrand(String quotedBrand) {
        this.quotedBrand = quotedBrand;
    }
}
